package com.aaa.mrcai.controller;

import com.aaa.mrcai.annotion.AAALog;
import com.aaa.mrcai.pojo.vo.GoodsBrandVo;
import com.aaa.mrcai.query.GoodsBrandQuery;
import com.aaa.mrcai.result.AjaxResult;
import com.aaa.mrcai.service.GoodsBrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Demo class
 *
 * @Author: Wang
 * @Date: Created in 19:43 2021/12/6
 */
@RestController
@RequestMapping("goodsBrand")
public class GoodsBrandController {
    @Autowired
    public GoodsBrandService goodsBrandService;

    @RequestMapping("list")
    public AjaxResult list(GoodsBrandQuery query){
        return goodsBrandService.list(query);
    }

    @RequestMapping("addGoodsBrand")
    @AAALog("添加商品品牌")
    public AjaxResult addGoodsBrand (GoodsBrandVo goodsBrandVo){
        return goodsBrandService.addGoodsBrand(goodsBrandVo);
    }

    @RequestMapping("/getGoodsBrand/{id}")
    public AjaxResult getGoodsBrand (@PathVariable("id") int id ){
        return goodsBrandService.getGoodsBrand(id);
    }

    @RequestMapping("updateGoodsBrand")
    @AAALog("修改商品品牌")
    public AjaxResult updateGoodsBrand (GoodsBrandVo goodsBrandVo){
        return goodsBrandService.updateGoodsBrand(goodsBrandVo);
    }

    @RequestMapping("/deleteGoodsBrand/{id}")
    @AAALog("删除商品品牌")
    public AjaxResult deleteGoodsBrand (@PathVariable("id") int id ){ return goodsBrandService.deleteGoodsBrand(id); }

}
